#ifndef GRAPH_H_
#define GRAPH_H_

#include <vector>

class Graph
{
public:
	typedef double AdjCoefType;
	typedef AdjCoefType * * AdjMatrixType;

	static const AdjCoefType DEFAULT_INF = 1e30;

public:
	Graph( int vertexCount = 0, AdjCoefType infEdge = DEFAULT_INF );
	virtual ~Graph();
	void init( int vertexCount = 0, AdjCoefType infEdge = -1 );

	Graph( const Graph & );
	void operator = ( const Graph & );

	int getVertexCount();
	AdjMatrixType getAdjacentMatrixArr();
	bool existsEdge( int from, int to );
	void eraseEdge( int from, int to );
	void eraseAllEdges();
	AdjCoefType getInfEdge();

private:
	std::vector< AdjCoefType > adjBuffer;
	std::vector< AdjCoefType * > hrdBuffer;
	AdjCoefType infEdge;
	int vertexCount;
	AdjMatrixType adjMatrix;
};

#endif /* GRAPH_H_ */
